package com.ruoyi.bantong.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.bantong.mapper.BtUserBankcardsMapper;
import com.ruoyi.bantong.domain.BtUserBankcards;
import com.ruoyi.bantong.service.IBtUserBankcardsService;

/**
 * 用户银行卡Service业务层处理
 * 
 * @author laohei
 * @date 2021-02-04
 */
@Service
public class BtUserBankcardsServiceImpl implements IBtUserBankcardsService 
{
    @Autowired
    private BtUserBankcardsMapper btUserBankcardsMapper;

    /**
     * 查询用户银行卡
     * 
     * @param ubId 用户银行卡ID
     * @return 用户银行卡
     */
    @Override
    public BtUserBankcards selectBtUserBankcardsById(Integer ubId)
    {
        return btUserBankcardsMapper.selectBtUserBankcardsById(ubId);
    }

    /**
     * 查询用户银行卡列表
     * 
     * @param btUserBankcards 用户银行卡
     * @return 用户银行卡
     */
    @Override
    public List<BtUserBankcards> selectBtUserBankcardsList(BtUserBankcards btUserBankcards)
    {
        return btUserBankcardsMapper.selectBtUserBankcardsList(btUserBankcards);
    }

    /**
     * 新增用户银行卡
     * 
     * @param btUserBankcards 用户银行卡
     * @return 结果
     */
    @Override
    public int insertBtUserBankcards(BtUserBankcards btUserBankcards)
    {
        btUserBankcards.setCreateTime(DateUtils.getNowDate());
        return btUserBankcardsMapper.insertBtUserBankcards(btUserBankcards);
    }

    /**
     * 修改用户银行卡
     * 
     * @param btUserBankcards 用户银行卡
     * @return 结果
     */
    @Override
    public int updateBtUserBankcards(BtUserBankcards btUserBankcards)
    {
        btUserBankcards.setUpdateTime(DateUtils.getNowDate());
        return btUserBankcardsMapper.updateBtUserBankcards(btUserBankcards);
    }

    /**
     * 批量删除用户银行卡
     * 
     * @param ubIds 需要删除的用户银行卡ID
     * @return 结果
     */
    @Override
    public int deleteBtUserBankcardsByIds(Integer[] ubIds)
    {
        return btUserBankcardsMapper.deleteBtUserBankcardsByIds(ubIds);
    }

    /**
     * 删除用户银行卡信息
     * 
     * @param ubId 用户银行卡ID
     * @return 结果
     */
    @Override
    public int deleteBtUserBankcardsById(Integer ubId)
    {
        return btUserBankcardsMapper.deleteBtUserBankcardsById(ubId);
    }
}
